home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BCI NET 2
/
BCI NET 2.iso
/
archives
/
sound
/
misc
/
ledv1_00.lha
/
led.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-26
|
2KB
|
76 lines
/************************
** LED/Filter switcher **
** V1.0 **
************************/
#include <exec/exec.h>
#include <exec/lists.h>
#include <exec/memory.h>
#include <exec/nodes.h>
#include <exec/types.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
/* die entsprechenden Matheroutinen includen */
#ifdef _M68881
#include <m68881.h>
#endif
/* Prototypes für Libraryfunctions */
#include <proto/exec.h>
/* Version | Revisionscontrol */
#define VERSION 1
#define REVISION 00
#define DATE "__Date__"
#define VERS "Led 1.00"
#define VSTRING "Led 1.00 ("__DATE__")\n\r"
#define VERSTAG "\0$VER: Led 1.00 ("__DATE__")"
/* Globals */
UBYTE VersTag[] =VERSTAG; /* Versionsstring */
UBYTE *PRA =(UBYTE *)0xbfe001; /* u.a. LED/Filter */
UBYTE main(int argc,char *argv[])
{
UBYTE ret=0;
printf("\n
Led V1.0\nby ENSONIC of TRINOMIC
\n\n");
if(argc!=2)
{
printf("Usage : led command\n");
printf("\tstatus :\n");
printf("\t\t0 : off\n");
printf("\t\t1 : on\n");
printf("\t\t2 : toggle\n");
printf("\t\t3 : status\n");
exit(0);
}
switch(atoi(argv[1]))
{
case 0: /* off */
*PRA|=(UBYTE)2; /* OR - setzen */
ret=5;
break;
case 1: /* On */
*PRA&=(UBYTE)65533; /* AND - ausmaskieren */
ret=0;
break;
case 2:
*PRA^=(UBYTE)2; /* XOR - toggeln */
ret=5-(5*((*PRA)&2)>>1);
break;
case 3: /* AND - abfragen */
ret=5-(5*((*PRA)&2)>>1);
break;
}
return(ret);
}